<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>面向对象 demo</title>
<link rel="stylesheet" href="css/base.css" />
<script>
function CreatObject( name, sex)
{
	this.name = name;
	this.sex = sex;
}

CreatObject.prototype.showName = function ()
{
	alert(this.name)
}

CreatObject.prototype.showSex = function ()
{
	alert(this.sex)
}

var p1= new CreatObject("yzx","男");
var p2= new CreatObject("ruby","女");

p1.showName();
p1.showSex();
p2.showName();
p2.showSex();


</script>
</head>
<body>
<div class="wrap">
	<h2 class="wrap-h2">javascript 面向对象！</h2>
	<div class="wrap-main wrap-index">
		<!--内容写这里-->
		
	</div>
</div>
</body>
</html>
